- append
ShaderVariablesLayout append(string varName, ShaderVar* v)
Undocumented in source. Be warned that the author may not have intended to support it.
- append
ShaderVariablesLayout append(string varName, T data)
Appends a new variable to this layout.
Type is inferred.
- appendBlackboxed
ShaderVariablesLayout appendBlackboxed(string varName, UniformType t, size_t length)
Appends a new variable to this layout.
Type is inferred.
- calcAlignment
void calcAlignment()
Calculates the shader variables alignment based on the packFunc passed at startup.
Those functions are based on the shader vendor and version. Align should be called
always when there is a change on the layout.
- dispose
void dispose()
Undocumented in source. Be warned that the author may not have intended to support it.
- getAdditionalData
const(void*) getAdditionalData()
Undocumented in source. Be warned that the author may not have intended to support it.
- getBlockData
void* getBlockData()
Undocumented in source. Be warned that the author may not have intended to support it.
- getLayoutSize
size_t getLayoutSize()
Undocumented in source. Be warned that the author may not have intended to support it.
- getShader
Shader getShader()
Undocumented in source. Be warned that the author may not have intended to support it.
- isUnused
bool isUnused(string varName)
For speed sake, it doesn't check whether it is valid.
That means both a valid and invalid variable would return false (meaning used.)
- lock
void lock(Shader owner)
Undocumented in source. Be warned that the author may not have intended to support it.
- opDispatch
auto opDispatch()
Undocumented in source. Be warned that the author may not have intended to support it.
- setAdditionalData
void setAdditionalData(void* d, bool isAllocated)
Undocumented in source. Be warned that the author may not have intended to support it.
This class is meant to be created together with the Shaders.
Those are meant to wrap the cbuffer from Direct3D and Uniform Block from OpenGL.
By wrapping the uniforms/cbuffers layouts, it is much easier to send those variables from any API.